package hanlen.mq.starter.core.impl;

import hanlen.mq.starter.bean.MessageWrap;
import hanlen.mq.starter.core.RedisQueueInterceptor;
import lombok.extern.slf4j.Slf4j;

/**
 * archives-service
 *
 * @author MrYe
 * @date 2021-10-23 16:02
 */
@Slf4j
public class RedisQueueInterceptorImpl implements RedisQueueInterceptor {

    @Override
    public <T> T preHandle(String queue, Integer backlogNums, MessageWrap message) {
        log.info("redis-queue:{} messageId:{} consumeNum:{} listener", queue, message.getMessageId(), backlogNums);
        return (T) message.getBody();
    }

}
